<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="./../template/receptionTemplate.xhtml">
	<ui:define name="header" />
	<ui:define name="footer" />
	<ui:define name="content">
		<h:form id="form">
			<h:panelGroup style="margin-left:5px;">
				<p:commandButton type="button" value="Start" icon="ui-icon-play"
					onclick="PF('poll').start()" id="btnStart" />
				<p:commandButton type="button" value="Stop" icon="ui-icon-pause"
					onclick="PF('poll').stop()" id="btnStop" />	
				<b>${sessionData.companyName}</b>	
			</h:panelGroup>
			<h:panelGrid columns="1" width="100%">
				<h:dataTable id="tokenTable"
					value="#{tokenController.waitingTokenList}" var="token"
					headerClass="TABLE_HEADER_XL" width="100%">
					<h:column>
						<f:facet name="header">Token No.</f:facet>
						<div class="#{token.statusCSS}">
							<h:outputText value="#{token.tokenNo}" />
						</div>
					</h:column>
					<h:column>
						<f:facet name="header">Name</f:facet>
						<div class="#{token.statusCSS}">
							<h:outputText value="#{token.personName}" />
						</div>
					</h:column>
					<h:column>
						<f:facet name="header">Mobile No.</f:facet>
						<div class="#{token.statusCSS}">
							<h:outputText value="#{token.mobileNo}" />
						</div>
					</h:column>
					<h:column>
						<f:facet name="header">Destination</f:facet>
						<div class="#{token.statusCSS}" style="width: 97%;">
							<h:outputText value="#{token.destinationName}"/>
						</div>
					</h:column>
				</h:dataTable>
			</h:panelGrid>
			<p:poll interval="3" listener="#{tokenController.waitingTokenList}"
				update="tokenTable" widgetVar="poll" autoStart="false" />
		</h:form>
	</ui:define>
</ui:composition>
</html>